//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
#ifndef PKT_FILE_LIST_REPLY_H
#define PKT_FILE_LIST_REPLY_H

#define PKT_LIST_WINDOWS	0x0000
#define PKT_LIST_LINUX		0x8000	
#define PKT_LIST_COMPLETE	0x0001	

#pragma pack(push) 
#pragma pack(1)
class PktFileListReply : public VxPktHdr
{
public:
	PktFileListReply()
	{
		m_u16PktType = PKT_TYPE_FILE_LIST_REPLY;
		m_u16PktLen = sizeof( PktFileListReply );
		bListComplete = FALSE;
		u32FileCnt = 0;
		as8FileList[ 0 ] = 0;
		vx_assert( 0 == (m_u16PktLen & 0x0f ) );
	}
	void CalcPktLen( int iDataLen )
	{
		u32DataLen = iDataLen;
		//calculate length of packet from length of file data
		m_u16PktLen = (unsigned short)ROUND_TO_16BYTE_BOUNDRY( sizeof( PktFileListReply ) - MAX_FILE_LIST_LEN  + iDataLen );
	}
	unsigned short bListComplete; // if 1 then list has been completed
	unsigned long u32FileCnt;	// number of files sent
	unsigned long u32DataLen;	// length of data
	char as8FileList[ MAX_FILE_LIST_LEN ];
};
#pragma pack(pop)


#endif //#ifndef PKT_FILE_LIST_REPLY_H


